const util = require("../../utils/util")
Page({

  /**
   * 页面的初始数据
   */
  data: {
    title: '',
    time: '',
    author: '',
    desc: '',
    description: ''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getWenZhagnDetail(options.id)
  },
  getWenZhagnDetail(id) {
    wx.request({
      url: `https://ku.qingnian8.com/wx_show.php?id=${id}`,
      success: (res) => {
        this.setData({
          title: res.data.title,
          time: util.formatTime(new Date(res.data.posttime*1000)),
          author: res.data.author,
          desc: res.data.content,
          description: res.data.description
        })
      }
    })
  }
})